{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='Date'>"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiQAAADzCAYAAAC2Vw3OAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAv7klEQVR4nO3dd3yV5f3/8dcnO5CEBBIQCRCQhCFLiCwVQarVaiviQAURreJq66jaWttif2prtXW0IoJIcSLU8bXDhbIcQAkKCLIRJKyEQEhCdnL9/jgHDDMhhNwnJ+/n45FHzrnu9bmD5rxzXdd93+acQ0RERMRLIV4XICIiIqJAIiIiIp5TIBERERHPKZCIiIiI5xRIRERExHMKJCIiIuK5MK8LqE5iYqJLSUnxugwRERGpA0uWLNnlnEs6tD3gA0lKSgoZGRlelyEiIiJ1wMw2H6ldQzYiIiLiOQUSERER8VyNAomZTTWzLDNbUaXtYTNbbmZLzewjMzv1kG3ONLNyM7uiStv1ZrbO/3V93Z2GiIiINGQ1nUMyDXgWeLlK2xPOud8BmNkvgN8Dt/rfhwJ/Bj7av7KZNQfGA+mAA5aY2b+cc3tO8BxERETqTFlZGZmZmRQXF3tdSoMWFRVFcnIy4eHhNVq/RoHEOTffzFIOacur8rYpvpCx38+Bt4Azq7T9EJjlnNsNYGazgAuB6TWqVEQavdLySrbvLWLrniK27y2mT/sEOiQ29bosCTKZmZnExsaSkpKCmXldToPknCMnJ4fMzEw6dOhQo21O6CobM3sUGAPsBYb629oAl/nfVw0kbYAtVd5n+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zrliM0sFpjvn0s1sCHCvc+4S//rjgJbOuUfMLBL4HLjSOfdtPZ6KiJxkYV4XICKNVjjwrP+W3hVA2lHWuwDoaWZX+N83A1Lx9aCISJBQIBGReuMfsqnA93TW8cBOoBe++WzFR9sM+Llz7sN6KVJEPKFJrSJSL8wsCXgeeNb5xoqbAdudc5XAdUCof9V8ILbKph8Ct/kfQ4+ZpZlZU0QkqKiHREROpmgzW4pveKYc3yTW/Y+Rfw54y8zGAB8A+/zty4EKM1sGTAOewXflzZf+x9FnA8Prp3wRqS+a1CoiIiKe05CNiIiIeE6BRERERDynQCIiIiKeUyARERERzymQiIiIiOcUSERERMRzCiQiIiLiOQUSERER8dz/BybL0wdLKjcHAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 648x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "gold_data=pd.read_csv('LBMA-GOLD.csv',parse_dates=['Date'],index_col='Date')[:20].dropna()\n",
    "# bit_data=pd.read_csv('BCHAIN-MKPRU.csv',parse_dates=['Date'],index_col='Date')[:100].dropna()\n",
    "gold_data.plot(figsize=(9,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2016-09-12', '2016-09-13', '2016-09-14', '2016-09-15',\n",
       "               '2016-09-16', '2016-09-19', '2016-09-20', '2016-09-21',\n",
       "               '2016-09-22', '2016-09-23', '2016-09-26', '2016-09-27',\n",
       "               '2016-09-28', '2016-09-29', '2016-09-30', '2016-10-03',\n",
       "               '2016-10-04', '2016-10-05', '2016-10-06', '2016-10-07'],\n",
       "              dtype='datetime64[ns]', name='Date', freq=None)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gold_data.index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "level check"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1323.65"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gold_data['USD (PM)'][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "n=len(gold_data)\n",
    "lambda_k=np.zeros(n-1)\n",
    "for i in range(n-1):\n",
    "    lambda_k[i]=gold_data['USD (PM)'][i]/gold_data['USD (PM)'][i+1]\n",
    "    if lambda_k[i]<np.exp(-2/(n+1)) or lambda_k[i]>np.exp(2/(n+2)):\n",
    "        flag=False\n",
    "        print(flag)\n",
    "    else:\n",
    "        flag=True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>USD (PM)</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2016-09-12</th>\n",
       "      <td>1324.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-13</th>\n",
       "      <td>1323.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-14</th>\n",
       "      <td>1321.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-15</th>\n",
       "      <td>1310.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-16</th>\n",
       "      <td>1308.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-19</th>\n",
       "      <td>1314.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-20</th>\n",
       "      <td>1313.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-21</th>\n",
       "      <td>1326.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-22</th>\n",
       "      <td>1339.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-23</th>\n",
       "      <td>1338.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-26</th>\n",
       "      <td>1340.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-27</th>\n",
       "      <td>1327.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-28</th>\n",
       "      <td>1322.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-29</th>\n",
       "      <td>1318.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-09-30</th>\n",
       "      <td>1322.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-10-03</th>\n",
       "      <td>1313.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-10-04</th>\n",
       "      <td>1283.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-10-05</th>\n",
       "      <td>1269.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-10-06</th>\n",
       "      <td>1254.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2016-10-07</th>\n",
       "      <td>1258.75</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            USD (PM)\n",
       "Date                \n",
       "2016-09-12   1324.60\n",
       "2016-09-13   1323.65\n",
       "2016-09-14   1321.75\n",
       "2016-09-15   1310.80\n",
       "2016-09-16   1308.35\n",
       "2016-09-19   1314.85\n",
       "2016-09-20   1313.80\n",
       "2016-09-21   1326.10\n",
       "2016-09-22   1339.10\n",
       "2016-09-23   1338.65\n",
       "2016-09-26   1340.50\n",
       "2016-09-27   1327.00\n",
       "2016-09-28   1322.50\n",
       "2016-09-29   1318.10\n",
       "2016-09-30   1322.50\n",
       "2016-10-03   1313.30\n",
       "2016-10-04   1283.30\n",
       "2016-10-05   1269.40\n",
       "2016-10-06   1254.50\n",
       "2016-10-07   1258.75"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gold_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n"
     ]
    }
   ],
   "source": [
    "n=len(gold_data)\n",
    "lambda_k=np.zeros(n-1)\n",
    "# c_list=[i/10 for i in range(-20000,20001)]\n",
    "c_list=[0]\n",
    "for c in c_list:\n",
    "    data=gold_data+c\n",
    "    flag_list=[]\n",
    "    for i in range(n-1):\n",
    "        lambda_k[i]=data['USD (PM)'][i]/data['USD (PM)'][i+1]\n",
    "        if lambda_k[i]<np.exp(-2/(n+1)) or lambda_k[i]>np.exp(2/(n+2)):\n",
    "            flag=False\n",
    "        else:\n",
    "            flag=True\n",
    "        flag_list.append(flag)\n",
    "    if not False in flag_list:\n",
    "        print(c)\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "x0=gold_data['USD (PM)']\n",
    "y0=data['USD (PM)']\n",
    "x0=np.array(x0)\n",
    "x1=np.cumsum(x0)\n",
    "\n",
    "x1=pd.DataFrame(x1)\n",
    "z1=(x1+x1.shift())/2.0\n",
    "z1=z1[1:].values.reshape((len(z1)-1,1))\n",
    "B=np.append(-z1,np.ones_like(z1),axis=1)\n",
    "Y=x0[1:].reshape((len(x0)-1,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "[[a],[b]]=np.dot(np.dot((np.linalg.inv(np.dot(B.T,B))),B.T),Y)\n",
    "f=lambda k:(x0[0]-b/a)*np.exp(-a*(k-1))-(x0[0]-b/a)*np.exp(-a*(k-2))\n",
    "x1_pre = [f(k) for k in range(1,len(x0)+1)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "检验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.01081263 0.00939332 0.00870101 0.01497074 0.01471527 0.00755812\n",
      " 0.00622532 0.00522147 0.01696756 0.01872214 0.02215413 0.01430063\n",
      " 0.01304375 0.01184879 0.01722463 0.01243843 0.00850514 0.01738656\n",
      " 0.0272875  0.02164819]\n",
      "[0.0014041255389125595, 0.0006858758988014246, -0.0062156485592312904, 0.0002516990153550447, 0.0070533639823381344, 0.0013228023193325722, 0.011375968143566562, 0.01180774493600445, 0.001784869348767093, 0.0034974719966133216, -0.008031436476010567, -0.0012751156685546494, -0.001210744172922551, 0.005440293924098283, -0.004870084439449807, -0.021207347309974534, -0.008806521417464186, -0.009731742273244803, 0.005489522627694088]\n"
     ]
    }
   ],
   "source": [
    "delta = np.abs(x0 - np.array([f(i) for i in range(1,len(x0)+1)]))\n",
    "residual_error = np.abs((x0-np.array(x1_pre))/x0)\n",
    "residual_error_max = residual_error.max\n",
    "print(residual_error)\n",
    "p = [1-((1-0.5*a)/(1+0.5*a))*l for l in lambda_k]\n",
    "print(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "检验结果成立"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下一天的预测值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1338.9224107338814"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1_pre[0]"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "b5fc3e43e814ad01a3162358639356c8d5269fa9e7a0a06af2b9cdf0ba130cad"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
